'use strict';

const Controller = require('egg').Controller;

class HomeController extends Controller {
  async index() {
    const { ctx } = this;
    var db = this.app.mongodb;
    const collection = await db.collection('member');
    var members = await collection.find().toArray();
    console.log(members);
    await ctx.render("/home",{members});
  }
}

module.exports = HomeController;
